<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:80:"D:\phpstudy_pro\WWW\nmg001\public/../application/admin\view\dustbins\search.html";i:1657873827;}*/ ?>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> <?php echo $setting['webname']; ?>- 回收站</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/footable/footable.core.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">


</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>回收站</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="<?php echo url('Admins/admin'); ?>">主页</a>
                </li>
                <li>
                    <strong>回收站</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">

        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <form action="" id="form1">
                <div class="row" style="margin-bottom: 20px">
                        <div class="col-sm-1">
                            <input type="text" placeholder="姓名" name="name" id="name" class="input form-control">
                        </div>
                        <div class="col-sm-1">
                            <select name="sex" id="sex" class="form-control">
                                <option value="" readonly selected>性别</option>
                                <option value="1">男</option>
                                <option value="0">女</option>
                            </select>
                        </div>
                        <div class="col-sm-1">
                            <input type="text" placeholder="民族" name="nation" id="nation" class="input form-control">
                        </div>
                        <div class="col-sm-1">
                            <select name="grade" id="grade" class="form-control">
                                <option value="" readonly selected>年级</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" placeholder="学生号码" name="phone" id="phone" class="input form-control">
                        </div>
                        <div class="col-sm-3">
                            <input type="text" placeholder="父母电话" name="parenttel" id="parenttel" class="input form-control">
                        </div>

                        <div class="col-sm-3">
                            <input type="text" placeholder="身份证号" name="idcards" id="idcards" class="input form-control">
                        </div>
                </div>
                <div class="row" style="margin-bottom: 20px">

                        <div class="col-sm-3">
                            <input type="text" placeholder="毕业学校所在地址" id="schooladdress" name="schooladdress" class="input form-control">
                        </div>
                        <div class="col-sm-3">
                            <input type="text" name="schoolname" placeholder="学校名称" id="schoolname" class="input form-control">
                        </div>
                        <div class="col-sm-3">
                            <input type="text" placeholder="通讯地址" name="address" id="address" class="input form-control">
                        </div>
                        <div class="col-sm-3">
                            <select name="major" id="major33"  class="form-control">
                                <option value="" readonly selected>专业1</option>
                                <?php foreach($course as $v): ?>
                                <option value="<?php echo $v['name']; ?>"><?php echo $v['name']; ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>

                </div>
                <div class="row" style="margin-bottom: 20px">

                    <div class="col-sm-3">
                        <select name="major2" id="major22"  class="form-control">
                            <option value="" readonly selected>专业2</option>
                            <?php foreach($course as $v): ?>
                            <option value="<?php echo $v['name']; ?>"><?php echo $v['name']; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                        <div class="col-sm-3">
                            <input type="text" placeholder="负责老师" name="teacher" id="teacher1" class="input form-control">
                        </div>
                            <div class="col-sm-3">
                                <input type="text" name="comment" placeholder="备注信息"  class="input form-control">
                            </div>
                        <div class="col-sm-2">
                            <button type="button" class="btn btn btn-info" style="width: 100%" id="search"> <i class="fa fa-search"></i> 综合搜索</button>
                        </div>
                    </form>
                </div>
                <div class="tabs-container">
                    <div class="tab-content">

                        <!--新闻列表开始-->
                            <div class="table-responsive">
                                <table class="footable table table-stripped toggle-arrow-tiny table-hover" data-page-size="15">
                                    <thead>
                                    <tr>
                                        <th data-toggle="true">编号</th>
                                        <th>姓名</th>
                                        <th>年级</th>
                                        <th>电话</th>
                                        <th>性别</th>
                                        <th>父母电话</th>
                                        <th>报考类别</th>
                                        <th>专业1</th>
                                        <th>专业2</th>
                                        <th>服从调剂</th>
                                        <th>负责老师</th>
                                        <th>回收时间</th>
                                        <th>备注</th>
                                        <th>操作</th>
                                        <th data-hide="all">民族</th>
                                        <th data-hide="all">qq/微信</th>
                                        <th data-hide="all">毕业学校所在地</th>
                                        <th data-hide="all">学校名称</th>
                                        <th data-hide="all">中考（模拟）成绩</th>
                                        <th data-hide="all">身份证号</th>
                                        <th data-hide="all">通讯地址</th>
                                        <th data-hide="all">报名时间</th>
                                        <th data-hide="all">报名修改时间</th>

                                    </tr>
                                    </thead>
                                    <tbody id="datas">

                                    </tbody>
                                </table>
                            </div>
                        <!-- 列表结束 -->
                        <tfoot>
                        <tr>
                            <td colspan="9">
                                <ul class="pagination pull-left"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </div>
                </div>
            </div>
        </div>
       
    </div>
    <!--弹出层-->
    <style>
        .layer_notice{
            width: 90%;
            margin:10px auto;
            line-height: 30px;
            display: none;
        }
        .layer_notice select{
            height: 35px;
        }
    </style>
    <!--修改负责老师和备注信息-->
    <div class="layer_notice" id="check">
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">姓名：</label>
            <div class="col-sm-7 col-sm-7" id="username" readonly> </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">负责老师：</label>
            <div class="col-sm-7 col-sm-7">
                <input type="text" id="teacher" name="teacher" placeholder="请输入负责老师" >
            </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;">备注：</label>
            <div class="col-sm-7 col-sm-7">
                <input type="hidden" id="id">
                <input type="text" id="comment" name="comment" placeholder="请输入备注">
            </div>
        </div>
        <div class="row">
            <label class="col-sm-5 col-xs-5" style="text-align: right;font-size:16px;"></label>
            <div class="col-sm-7 col-sm-7"></div>
        </div>
        <div class="row">
            <div class="col-sm-12" style="text-align: right;">
                <button class="btn closes">取消</button>
                <button class="btn btn-info" id="classAddStudent">保存修改</button>
            </div>
        </div>
    </div>

    <!--弹出层-->
    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>

    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- iCheck -->
    <script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Switchery -->
    <script src="/public/static/admin/js/plugins/switchery/switchery.js"></script>

    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script src="/public/static/admin/js/plugins/footable/footable.all.min.js"></script>
    <script src="/public/static/admin/js/jquery.jqprint-0.3.js"></script>
    <script>
        $(document).ready(function() {
            $('.footable').footable();
            $(".tabs").attr("class","tab-pane");
        });
        var dateyear = new Date().getFullYear();
        for(i=dateyear;i>=dateyear-10;i--) {
            $("#grade").append($("<option value="+i+">"+i+"</option>"));
        }
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //删除
            $("#datas").on("click",".del",function(){
                var s = $(this);
                top.layer.msg('你确定要永久删除"'+s.data('name')+'"吗？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("<?php echo url('Dustbins/deletes'); ?>",{id:s.attr('data-id')},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                $("#search").click();
                            });
                        });
                    }
                });
            });
            //查询内容
            $("#search").on("click",function(){
                 var form = $("#form1").serializeArray()
                 var data = {}
                 form.forEach((_this)=>{
                     data[_this.name] = _this.value;
                })
                console.log(data);
                $.post("<?php echo url('Dustbins/toSearch'); ?>", data ,function(data){
                    if(data.code){
                        $("#datas").html(data.msg).trigger('footable_redraw');
                    }else{
                        top.layer.closeAll();
                        top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                            if(data.url){
                                window.location.href = data.url;
                            }
                        });
                    }
                });
            });
            $("#search").click();
            //修改信息
            $("#datas").on("click",".comm",function(){
                var s = $(this);
                $("#id").val(s.data("id"));
                $("#username").text(s.data("name"));
                $("#teacher").val(s.data("teacher"));
                $("#comment").val(s.data("comment"));
                //页面层
                layer.open({
                    type: 1,
                    skin: false, //加上边框
                    title: "备注信息",
                    area: ['300px', 'AUTO'], //宽高
                    content: $("#check")  //调到新增页面
                });
            });
            //保存修改的信息
            $("#classAddStudent").click(function(){
                var s = $(this);
                $.post("<?php echo url('Dustbins/toUpdate'); ?>", {
                    id: $("#id").val(),
                    teacher:$("#teacher").val(),
                    comment:$("#comment").val()
                }, function (data) {
                    layer.closeAll();
                    top.layer.msg(data.msg, {time: 2000,shade:0.5}, function () {

                            $("#search").click();

                    });
                })
            });
        });

    </script>

    
    

</body>

</html>
